#include "mainWindow.h"
#include <QDebug>

mainWindow::mainWindow(QWidget * parent,Qt::WindowFlags f)
:QWidget(parent,f)
{
    this->layout=new QVBoxLayout(this);

    this->layout1=new QVBoxLayout(this);
    this->textEdit=new QTextEdit(this);
    
    this->layout2=new QHBoxLayout(this);
    this->lineEdit=new QLineEdit(this);
    this->pushButton=new QPushButton(this);
    this->pushButton->setText("send");

    this->layout1->addWidget(textEdit);
    this->layout2->addWidget(lineEdit);
    this->layout2->addWidget(pushButton);
    this->layout->addLayout(layout1);
    this->layout->addLayout(layout2);

    this->setLayout(layout);

    connect(this->pushButton,SIGNAL(clicked()),this,SLOT(myClicked()));

}

void mainWindow::myClicked()
{
    this->textEdit->append(this->lineEdit->text());
    this->lineEdit->setText('\0');
}